package com.welica.wat.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
* @ClassName: LockConfig
* @Description: 基于redssion实现的分布式锁配置类
* @author weiyongpeng
* @date 2024年11月1日 下午8:49:03
 */
@Configuration
@Order(Ordered.HIGHEST_PRECEDENCE)
@ConfigurationProperties(prefix = "distributed.lock.redis")
public class RedisLockConfig {
	
	/**
     * 红锁地址列表
     */
    private String[] host;

    /**
     * 单机还是集群还是多节点 single单机默认，cluster集群，sentinel哨兵，multi多节点
     */
    private String mode;
    
    /**
     * 尝试获取锁等待时间
     */
    private int wait;

	public String[] getHost() {
		return host;
	}

	public void setHost(String[] host) {
		this.host = host;
	}

	public int getWait() {
		return wait;
	}

	public void setWait(int wait) {
		this.wait = wait;
	}

	public String getMode() {
		return mode;
	}

	public void setMode(String mode) {
		this.mode = mode;
	}
    
}
